﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SchEdu.Framework.DataModel;
using SchEdu.Framework.Validators;

namespace SchEdu.Framework.Objective
{
    class TotalCompletionTime : Objective
    {
        public TotalCompletionTime()
            : base()
        {
        }
        public TotalCompletionTime(SchEduData schEduData, SchEduDataSet.SolutionRow solution)
            : base(schEduData, solution)
        {
        }
        protected override void Logic()
        {
            int totalCompletionTime = 0;


            foreach (SchEduDataSet.OrderRow order in SchEduData.Order)
            {
                totalCompletionTime += (int)order.ProcessingTime;
            }

        }

        protected override void InitializeValidators()
        {
            base.InitializeValidators();
            validators.Add(new OrderProcessingTimeValidator(SchEduData));
        }

        public override AboutInfo AboutInfo
        {
            get
            {
                AboutInfo aboutInfo = new AboutInfo();
                aboutInfo.Title = "Total Completion Time";
                aboutInfo.Guid = new Guid("{9FA93B31-E031-42d0-9194-22547CD4FDF0}");
                aboutInfo.Description = Resources.TotalCompletionTimeDescription;
                return aboutInfo;
            }
        }

    }
}
